
#ifndef VELOCITYCHANGE_H_
#define VELOCITYCHANGE_H_

#include "Core.h"
#include "Entity.h"

namespace p2
{

class VelocityChange
{
public:
	inline VelocityChange()
	:	_dv(Vector2<real>::ZERO), _dw(0.f)
	{
	}
	inline VelocityChange(VelocityChange const& data)
	:	_dv(data._dv), _dw(data._dw)
	{
	}
	virtual ~VelocityChange();

	inline void reset()
	{
		_dv = Vector2<real>::ZERO;
		_dw = 0.f;
	}
	inline void getEntityVelocities(Entity const* entity)
	{
		_dv = entity->getV();
		_dw = entity->getW();
	}
	inline void setEntityVelocities(Entity* entity) const
	{
		entity->setV(_dv);
		entity->setW(_dw);
	}
	inline Vector2<real> const& getV() const
	{
		return _dv;
	}
	inline void incV(Vector2<real> dv)
	{
		_dv += dv;
	}
	inline real getW() const
	{
		return _dw;
	}
	inline void incW(real dw)
	{
		_dw += dw;
	}

private:
	Vector2<real> _dv;
	real _dw;
};

} /* namespace p2 */
#endif /* VELOCITYCHANGE_H_ */
